package controllers;

import java.util.Map.Entry;

import models.Weixin;
import net.ufrog.common.Logger;
import net.ufrog.common.utils.Strings;
import play.mvc.Controller;
import weixin.WXRequest;
import weixin.resp.AccessToken;

/**
 * 前行控制器
 * 
 * @author ultrafrog
 * @version 1.0, 2014-11-21
 * @since 1.0
 */
public class Eqxing extends Controller {

	public static final String SESSION_USER	= "play_eqianxing_session_user";
	
	/**
	 * 索引
	 * 
	 * @param code
	 */
	public static void index(String code) {
		if (Strings.empty(code)) {
			session.put(SESSION_USER, "oebhnt5o8UeF-02xaTKF1L1938Bw");
		} else {
			AccessToken atoken = WXRequest.OAuth.accessToken(Weixin.current(), code);
			session.put(SESSION_USER, atoken.openId);
		}
		render();
	}
	
	/** 借款列表 */
	public static void loan_list() {
		render();
	}
	
	/** 用户中心 */
	public static void user() {
		
	}
}
